/**
 * 消息提示
 * msg:消息提示文字
 * icon:提示小图标,可选值 success, error ,warning, info
 * time:持续时间,毫秒
 */
(function ($) {
    var $msgbox = function (options) {

        //去除上一个div对下一次显示提示信息的影响
        var boxEle = document.getElementById("ts_Msgbox");
        if (boxEle != null) {
            boxEle.parentNode.removeChild(boxEle);
        }

        var defaults = {
            msg: '系统提示',
            icon: 'clear',
            time: '6000'
        };

        var settings = jQuery.extend(defaults, options);
        var tipiconclass = "gtl_ico_" + settings.icon;
        var box = "<div class=\"ts_msgbox_layer_wrap\" id=\"ts_Msgbox\" style=\"display:none;\"><span class=\"ts_msgbox_layer\" style=\"z-index: 10000;\" id=\"mode_tips_v2\"><span class=\"" + tipiconclass + "\"></span>" + settings.msg + "<span class=\"gtl_end\"></span></span></div>";
        $("body").append(box);
        $('#ts_Msgbox').fadeIn();
        window.setTimeout("$('#ts_Msgbox').fadeOut();", settings.time / 2);
    };
    $.msgbox = function (options) {
        return new $msgbox(options);
    };
    return $.msgbox;
})(jQuery);





